<template>
  <div class="card-item-content">
    <BaseDatilebox
      v-for="(item, index) in dataSource"
      :key="item.id"
      :boxTitle="item"
      :isshowWtdg="true"
      :disabled="!finishFlag"
      @checkfxzb="checkfxzb"
      @checkwtdg="checkwtdg"
    >
      <template v-slot:boxContent v-if="!finishFlag">
        <div class="item-content-box">
          <p>
            模&emsp;&emsp;型：
            <a-tooltip placement="topLeft" overlayClassName="bgc_tooltip1">
              <template slot="title">
                <span>{{ item.resultDesc }}</span>
              </template>
              <span class="item-content-b box-card-subtitle">{{ item.mxlx }}</span>
            </a-tooltip>
          </p>
          <p class="analyzeResult">
            分析结果：
            <a-tooltip placement="topLeft" overlayClassName="bgc_tooltip1">
              <template slot="title">
                <span>{{ item.fxjg }}</span>
              </template>
              <span class="item-content-b box-card-subtitle">{{ item.fxjg }}</span>
            </a-tooltip>
          </p>
          <!-- <p>
            模型名称：<span class="item-content-b">{{ item.mxmc }}</span>
          </p> -->
        </div>
      </template>
      <template v-slot:boxContent v-else>
        <p>
          模&emsp;&emsp;型：
          <a-tooltip placement="topLeft" overlayClassName="bgc_tooltip1">
            <template slot="title">
              <span>{{ item.resultDesc }}</span>
            </template>
            <span class="item-content-b box-card-subtitle">{{ item.pmodelName }}</span>
          </a-tooltip>
        </p>
        <div class="item-content-box">
          <p class="analyzeResult">
            分析结果：
            <a-tooltip placement="topLeft" overlayClassName="bgc_tooltip1">
              <template slot="title">
                <span>{{ item.resultDesc }}</span>
              </template>
              <span class="item-content-b">{{ item.resultDesc }}</span>
            </a-tooltip>
          </p>
          <p>
            创建时间：<span class="item-content-b">{{ item.createTime | createTime }}</span>
          </p>
        </div>
      </template>
    </BaseDatilebox>
  </div>
</template>

<script>
import BaseDatilebox from '../BaseDatilebox'
export default {
  name: 'TransitionModel',
  components: { BaseDatilebox },
  data() {
    return {}
  },
  props: {
    dataSource: {
      type: Array,
      default: [],
    },
    finishFlag: {
      type: Boolean,
      default: false,
    },
  },
  watch: {
    finishFlag: {
      immediate: true,
      handler(val) {
        console.log(val)
      },
    },
  },
  filters: {
    createTime(time) {
      if(time)
      return time.split(' ')[0]
      else 
      return time
    },
  },
  methods: {
    checkfxzb(modelId) {
      this.$emit('checkAnalysisIndex', modelId)
    },
    checkwtdg(modelId,boxTitlename) {
      this.$emit('checkQuestionPapers', modelId,boxTitlename)
    },
  },
}
</script>

<style lang="less" scoped>
.baseDatilebox {
  height: 260px;
}
</style>